﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace IdentityMine.Windows.Eventing
{
    public static class Extensions
    {

        public static void AddHandlerEx(this UIElement fe, RoutedEventEx routedEvent, Delegate handler)
        {
            fe.AddHandler(routedEvent.RoutedEvent, handler);
        }

        public static void AddHandlerEx(this UIElement fe, RoutedEventEx routedEvent, Delegate handler, bool handledEventsToo)
        {
            fe.AddHandler(routedEvent.RoutedEvent, handler, handledEventsToo);
        }

        public static void RaiseEventEx(this UIElement fe, RoutedEventArgsEx args)
        {
            fe.RaiseEvent(args);
        }

        public static void RemoveHandlerEx(this UIElement fe, RoutedEventEx routedEvent, Delegate handler)
        {
            fe.RemoveHandler(routedEvent.RoutedEvent, handler);
        }

        public static void AddHandlerEx(this UIElement fe, RoutedEvent routedEvent, Delegate handler)
        {
            fe.AddHandler(routedEvent, handler);
        }

        public static void AddHandlerEx(this UIElement fe, RoutedEvent routedEvent, Delegate handler, bool handledEventsToo)
        {
            fe.AddHandler(routedEvent, handler, handledEventsToo);
        }

        public static void RemoveHandlerEx(this UIElement fe, RoutedEvent routedEvent, Delegate handler)
        {
            fe.RemoveHandler(routedEvent, handler);
        }

    }
}
